]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
telepathyClient: Remove some obsolete wrappers
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 14 Aug 2012 19:21:10 +0000 (16:21 -0300)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 17 Aug 2012 00:10:24 +0000 (20:10 -0400)
gjs can handle these cases natively now

https://bugzilla.gnome.org/show_bug.cgi?id=682045

js/ui/telepathyClient.js
src/shell-tp-client.c
src/shell-tp-client.h

index fb9575bce089270e0fa3e22d5b512891351200eb..5d66bbedb66b4c69a6970ede5ae7a8e9cae7da2e 100644 (file)
@@ -132,7 +132,7 @@ const Client = new Lang.Class({
             let channel = channels[i];
             let [targetHandle, targetHandleType] = channel.get_handle();
 
-            if (Shell.is_channel_invalidated(channel))
+            if (channel.get_invalidated())
               continue;
 
             /* Only observe contact text channels */
@@ -184,7 +184,7 @@ const Client = new Lang.Class({
                 continue;
             }
 
-            if (Shell.is_channel_invalidated(channel))
+            if (channel.get_invalidated())
               continue;
 
             // 'notify' will be true when coming from an actual HandleChannels
@@ -211,13 +211,15 @@ const Client = new Lang.Class({
         // We can only approve the rooms if we have been invited to it
         let selfContact = channel.group_get_self_contact();
         if (selfContact == null) {
-            Shell.decline_dispatch_op(context, 'Not invited to the room');
+            context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
+                                        message: 'Not invited to the room' }));
             return;
         }
 
         let [invited, inviter, reason, msg] = channel.group_get_local_pending_contact_info(selfContact);
         if (!invited) {
-            Shell.decline_dispatch_op(context, 'Not invited to the room');
+            context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
+                                        message: 'Not invited to the room' }));
             return;
         }
 
@@ -237,8 +239,9 @@ const Client = new Lang.Class({
         let channel = channels[0];
         let chanType = channel.get_channel_type();
 
-        if (Shell.is_channel_invalidated(channel)) {
-            Shell.decline_dispatch_op(context, 'Channel is invalidated');
+        if (channel.get_invalidated()) {
+            context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
+                                        message: 'Channel is invalidated' }));
             return;
         }
 
@@ -249,7 +252,8 @@ const Client = new Lang.Class({
         else if (chanType == Tp.IFACE_CHANNEL_TYPE_FILE_TRANSFER)
             this._approveFileTransfer(account, conn, channel, dispatchOp, context);
         else
-            Shell.decline_dispatch_op(context, 'Unsupported channel type');
+            context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
+                                        message: 'Unsupported channel type' }));
     },
 
     _approveTextChannel: function(account, conn, channel, dispatchOp, context) {
index 8dc3492413feac788375715ff29c1b50bcf235aa..b6232e5bd8c3f92b85c4eec75179deb3f00f1b9f 100644 (file)
@@ -327,23 +327,3 @@ shell_tp_client_grab_contact_list_changed (ShellTpClient *self,
                     G_CALLBACK (on_contact_list_changed),
                     self);
 }
-
-/* Telepathy utility functions */
-
-/* gjs doesn't allow us to craft a GError so we need a C wrapper */
-void
-shell_decline_dispatch_op (TpAddDispatchOperationContext *context,
-    const gchar *message)
-{
-  GError *error = g_error_new_literal (TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
-      message);
-
-  tp_add_dispatch_operation_context_fail (context, error);
-  g_error_free (error);
-}
-
-/* gjs doesn't cope with tp_proxy_get_invalidated() returning a GError */
-gboolean shell_is_channel_invalidated (TpChannel *channel)
-{
-  return tp_proxy_get_invalidated (channel) != NULL;
-}
index c39c78f6d1250c4624cf8499ceadd3113c7a09cf..107bcb46ace93c0bc93c0b144dfc11cb232f7fa3 100644 (file)
@@ -100,12 +100,5 @@ void shell_tp_client_set_contact_list_changed_func (ShellTpClient *self,
 void shell_tp_client_grab_contact_list_changed (ShellTpClient *self,
     TpConnection *conn);
 
-/* Telepathy utility functions */
-
-void shell_decline_dispatch_op (TpAddDispatchOperationContext *context,
-                                const gchar *message);
-
-gboolean shell_is_channel_invalidated (TpChannel *channel);
-
 G_END_DECLS
 #endif /* __SHELL_TP_CLIENT_H__ */